﻿{include file="public/header"}
<title>订单录入</title>
</head>
<body>


<article class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-member-add">
        <div class="ch-row ch-info-form">
            <input type="hidden" name="agency_id" value="{$data.agency_id}">
            <p class="flex1">供应商名称：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="{$data.agency_name}" name="agency_name">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">供应商类型：</p>
            <div class="flex2">
                <select name="range" class="ch-info-select form-control">
                    <option value="0" {if($data.rangess==0)} selected="selected" {/if}>请选择</option>
                    <option value="1" {if($data.rangess==1)} selected="selected" {/if}>主材供应商</option>
                </select>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">公司地址：</p>
            <div class="flex2">
                <div class="ch-pc-row">
                    <select name="province" class="province form-control ch-info-select" onmouseover="privance()">
                        <option selected="selected" value="{$data.province_id}">{$data.province}</option>
                    </select>
                    <select name="citys" class="city form-control ch-info-select">
                        <option selected="selected" value="{$data.city_id}">{$data.city}</option>
                    </select>
                    <select name="area" class="area form-control">
                        <option selected="selected" value="{$data.county_id}">{$data.county}</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">供应范围：</p>
            <div class="flex2">
                <select name="business" class="ch-info-select form-control">
                    {volist name='supply' id='vo'}
                    <option  value="{$vo.id}" {if($data.belonging_to==$vo.id)} selected="selected" {/if}>{$vo.title}</option>
                    {/volist}

                </select>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">主供商品备注：</p>
            <div class="flex2">
                <textarea type="text" class="form-control fid"  name="product_notes">{$data.product_notes}
                </textarea>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">所属城市：</p>
            <div class="flex2">
                <div class="ch-pc-row">
                    <select name="belonging_to" class="ch-info-select form-control">
                        <option  value="">请输入地址</option>
                        {volist name='city' id='vo'}
                        <option  value="{$vo.city_id}" {if($data.belonging_to==$vo.city_id)} selected="selected" {/if}>{$vo.city}</option>
                        {/volist}
                    </select>
                </div>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 业务范围：</p>
            <div class="flex2">
                <div class="ch-pc-row">
                    <select name="scope_business" class="ch-info-select form-control ">
                        <option selected="selected" value="">请输入地址</option>
                        {volist name='city' id='vo'}
                        <option  value="{$vo.city_id}" {if($data.belonging_to==$vo.city_id)} selected="selected" {/if}>{$vo.city}</option>
                        {/volist}
                    </select>
                </div>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">联系人：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="{$data.contacts}" name="contacts"/>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 联系电话：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="{$data.telephone}" name="telephone" placeholder="请输入联系电话">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 收款账户类型：</p>
            <div class="flex2">
                <input type="radio" name="account_type" value="2" {if($data.account_type==2)} checked {/if}>个人账户
                &nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio"  name="account_type" value="1" {if($data.account_type==1)} checked {/if}>对公账户
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 收款账户名称：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="{$data.collection_name}" name="collection_name" placeholder="请输入收款账户名称">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 收款账号：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="{$data.collection_number}" name="collection_number" placeholder="请输入收款账号">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">  收款银行：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="{$data.bank}" name="bank" placeholder="请输入收款银行">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">  开户行：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="{$data.bank_of_deposit}" name="bank_of_deposit" placeholder="请输入收款银行">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">   状态：</p>
            <div class="flex2">

                <input type="radio" name="state" value="0" {if($data.state==0)} checked {/if}>冻结

                <input type="radio"  name="state" value="1" {if($data.state==1)} checked {/if}>正常


                &nbsp;&nbsp;&nbsp;&nbsp;

            </div>
        </div>
        <div class="ch-row">
            <div class="flex1">
                <button class="btn btn-primary radius" type="button" style="width: 100%;"><i class="Hui-iconfont">&#xe632;</i>
                    提交
                </button>
            </div>
        </div>
    </form>
</article>
{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var content = $('.content').val();
        var label_id = $('.label_id').val();

        if (content == "") {
            alert('请填写后提交');
        } else {
            var src = "{:Url('index/Agency/edit')}?city="+ (getCookie('token').split('.'))[1];
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data: $('form').serializeArray(),
                success: function (data) {
                    var res = JSON.parse(data);
                    if (res.code == 200) {
                        layer.msg(res.msg, {icon: 1, time: 2000}, function (index, layero) {
                            parent.location.reload()
                        });
                    } else {
                        layer.msg(res.msg, {icon: 5, time: 1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        }


    });
</script>
</body>
</html>